package ooday01;

public class ExtendsTest {
    public static void main(String[] args) {
        Student lj=new Student();
        lj.name="lj";
        lj.age=21;
        lj.address="德州";
        lj.classname="jsd2410";
        lj.stuId="001";
        lj.eat();
        lj.sleep();
        lj.sayHi();
        lj.study();

        Student lh=new Student("lh",19,"林县","jsd2411","001");
        lh.eat();
        lh.sleep();
        lh.sayHi();
        lh.study();


        Teacher lcy=new Teacher("lcy",57,"dz",6000);
        lcy.eat();
        lcy.sleep();
        lcy.sayHi();
        lcy.thacher();



        Doctor zh=new Doctor("zh",21,"lx","zrys");
        zh.eat();
        zh.sleep();
        zh.sayHi();

        Person p = new Person();
        p.name="ll";
        p.age=21;
        p.address="1";
        p.eat();
        p.sleep();
        p.sayHi();
        //p.stuId="005";//编译错误，超类不能访问派生类
    }
}
